﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace CommonSearchModule
{
    /// <summary>
    /// 索引文件配置
    /// </summary>
    public class IndexDocumentsConfig
    {
        public static string GetIndexDocumentPath(SearchModule searchModule)
        {
            switch (searchModule)
            {
                case SearchModule.Ask:
                    return ConfigurationManager.AppSettings["Ask_IndexDocumentsPath"];
                case SearchModule.Fudao:
                    return ConfigurationManager.AppSettings["CourseRequirement_IndexDocumentsPath"];
                case SearchModule.Item:
                    return ConfigurationManager.AppSettings["Res_Item_IndexDocumentsPath"];
                case SearchModule.JiaoAn:
                    return ConfigurationManager.AppSettings["JiaoAn_IndexDocumentsPath"];
                case SearchModule.ShiTi:
                    return ConfigurationManager.AppSettings["ShiJuan_IndexDocumentsPath"];
                default:
                    return string.Empty;
            }
        }
    }

    /// <summary>
    /// lucene搜索模块
    /// </summary>
    public enum SearchModule
    {
        /// <summary>
        /// 课程
        /// </summary>
        Item = 1,
        /// <summary>
        /// 辅导
        /// </summary>
        Fudao = 2,
        /// <summary>
        /// 问答
        /// </summary>
        Ask = 3,
        /// <summary>
        /// 试题
        /// </summary>
        ShiTi = 4,
        /// <summary>
        /// 教案
        /// </summary>
        JiaoAn = 5,
    }

}
